import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: () => import( '../views/LoginView.vue')
  },
  {
    path: '/home',
    component: HomeView,
    name: 'home',


    children: [
      // ====================== 以下是【订单】的路由配置 ======================
      {
        path: '/service/order',
        component: () => import('../views/service/OrderListView')
      },
      {
        path: '/service/order/add',
        component: () => import('../views/service/OrderAddView')
      },

      // ====================== 以下是【客户】的路由配置 ======================
      {
        path: '/service/customer',
        component: () => import('../views/service/CustomerListView')
      },
      {
        path: '/service/customer/add',
        component: () => import('../views/service/CustomerAddView')
      },

      // ====================== 以下是【医生】的路由配置 ======================
      {
        path: '/service/doctor',
        component: () => import('../views/service/DoctorListView')
      },
      {
        path: '/service/doctor/add',
        component: () => import('../views/service/DoctorAddView')
      },



      // ====================== 以下是【就诊】的路由配置 ======================
      {
        path: '/service/treat',
        component: () => import('../views/service/TreatListView')
      },
      {
        path: '/service/treat/add',
        component: () => import('../views/service/TreatAddView')
      },

      // ====================== 以下是【药品】的路由配置 ======================
      {
        path: '/service/medicine',
        component: () => import('../views/service/MedicineListView')
      },
      {
        path: '/service/medicine/add',
        component: () => import('../views/service/MedicineAddView')
      },
      {
        path: '/service/medicine-category',
        component: () => import('../views/service/MedicineCategoryListView')
      },
      {
        path: '/service/medicine-category/add',
        component: () => import('../views/service/MedicineCategoryAddNewView')
      },
      // ====================== 以下是【科室】的路由配置 ======================
      {
        path: '/service/department',
        component: () => import('../views/service/DepartmentListView')
      },
      {
        path: '/service/department/add',
        component: () => import('../views/service/DepartmentAddView')
      },


      // ====================== 以下是【分析】的路由配置 ======================
      {
        path: '/service/analysis',
        component: () => import('../views/service/AnalysisListView')
      },
      {
        path: '/service/analysis/add',
        component: () => import('../views/service/AnalysisAddView')
      },

      // ====================== 以下是【权限管理】的路由配置 ======================
      {
        path: '/admin/authority/admin',
        component: () => import('../views/admin/AuthorityListView')
      },
      {
        path: '/admin/authority/admin/add',
        component: () => import('../views/admin/AuthorityAddView')
      },

      // ====================== 以下是【诊断管理】的路由配置 ======================
      {
        path: '/service/record',
        component: () => import('../views/service/RecordListView')
      },
      {
        path: '/service/record/add',
        component: () => import('../views/service/RecordAddView')
      },
    ]
  },

]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
